package io;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.Scanner;

public class TestNote {
    public static void main(String[] args) throws IOException {
        Scanner scan = new Scanner(System.in);
        FileOutputStream fos = new FileOutputStream("note.txt");
        String aa = "exit";
        while (true){
            System.out.println("请输入内容：");
            String ss=scan.nextLine();
            byte[] data=ss.getBytes(StandardCharsets.UTF_8);
            if(aa.equals(ss)){
                System.out.println("退出程序");
                break;
            }
            fos.write(data);
        }
        fos.close();
    }
}
